
function fillInformation(){
    document.getElementById("s2").className="show";
    document.getElementById("s1").className="hidden";
    document.getElementById("s3").className="hidden";
    document.getElementById("s4").className="hidden";
    document.getElementById("s5").className="hidden";
    document.getElementById("s6").className="hidden";
    document.getElementById("s7").className="hidden";
}
function cancelInformation(){
    document.getElementById("s3").className="hidden";
    document.getElementById("s1").className="show";
    document.getElementById("s2").className="hidden";
    document.getElementById("s4").className="hidden";
    document.getElementById("s5").className="hidden";
    document.getElementById("s6").className="hidden";
    document.getElementById("s7").className="hidden";
}
function recordInformation(){
    let screenName=document.getElementById("myScreenName").value;
    let birthday=document.getElementById("myBirthday").value;
    let sex=document.getElementById("mySex").value;
    let name=document.getElementById("myName").value;
    let phone=document.getElementById("myPhone").value;
    let phonePattern=/^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/;
    let birthdayPattern=/^((19\d{2})|(200\d))-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2]\d|3[0-1])$/;
    let sexPattern=/^男$|^女$/;
    let namePattern=/^[\u4E00-\u9FA5]{2,4}$/;
    if(screenName===""){
        alert("网络昵称不能为空");
        return ;
    }else{
        if(birthday===""){
            alert("生日不能为空");
            return;
        }else{
            if(sex===""){
                alert("性别不能为空");
                return ;
            }else{
                if(name===""){
                    alert("姓名不能为空");
                    return ;
                }else{
                    if(phone===""){
                        alert("电话不能为空");
                        return ;
                    }else{
                        if(namePattern.test(name)){
                            if(sexPattern.test(sex)){
                                if(birthdayPattern.test(birthday)){
                                    if(phonePattern.test(phone)){
                                        document.getElementById("updateForm").submit();
                                        document.getElementById("fillInformation").className="hidden";
                                        document.getElementById("displayInformation").className="show";
                                    }else{
                                        alert("电话格式错误");
                                        return ;
                                    }
                                }else{
                                    alert("生日格式错误，示例：1980-5-12或1988-05-04");
                                    return;
                                }
                            }else{
                                alert("性别格式错误");
                                return ;
                            }
                        }else{
                            alert("姓名格式错误");
                            return;
                        }
                    }
                }
            }
        }
    }
}